/** @jsxImportSource @emotion/react */
import * as React from "react";
import {
    Text, LineColumn, InputLine, TextArea, Input, Select, BlobInputList
} from "customize-easy-ui-component";
import {
    InspectRecordLayout, InternalItemProps, useItemInputControl,
} from "../common/base";
import {useMeasureInpFilter} from "../common/hooks";


interface Props  extends InternalItemProps{
    label?: string;
    titles?: any[];
    /**不需要加 备注字段的*/
    nmemo?:boolean;
    jrcap?:string;
}
export const itemA下结论=['检验结论','检验日期','检验日期1','新下检日','结论说明','参检人员'];
/**通用见证材料3项的： 约定：children [] 可以嵌入俩个儿子DOM节点，分别代表两个段落插入一个div块;
 * */
export const ConclusionGasC=
React.forwardRef((
    { children, show ,alone=true,redId,nestMd,label,titles,nmemo,jrcap}:Props,  ref
) => {
    const [getInpFilter]=useMeasureInpFilter(null,itemA下结论,);
    const {inp, setInp} = useItemInputControl({ ref });
    return <InspectRecordLayout inp={inp} setInp={setInp} getInpFilter={getInpFilter} show={show} redId={redId}
                                nestMd={nestMd} alone={alone} label={label!}>
        <InputLine label='参检人员：'>
            <BlobInputList value={inp?.参检人员 || ''} rows={2}
                           onListChange={v => setInp({...inp, 参检人员: v || undefined}) } />
        </InputLine>
        <Text variant="h5">检验结论-检查结论{'>>'}</Text>
        <InputLine  label={jrcap??'检验结论'}>
            <Select inputSize="md" css={{minWidth:'140px',fontSize:'1.3rem',padding:'0 1rem'}}
                 value={ inp?.检验结论  ||''} onChange={e => setInp({ ...inp, 检验结论: e.currentTarget.value||undefined}) }>
                <option></option>
                <option>合格</option>
                <option>不合格</option>
            </Select>
        </InputLine>
        <LineColumn column={4}>
            <InputLine label='设置检验日期'>
                <Input value={inp?.检验日期 || ''} type='date'
                       onChange={e => setInp({...inp, 检验日期: e.currentTarget.value})}/>
            </InputLine>
            <InputLine  label='检验起始日期' >
                <Input  value={inp?.检验日期1 ||''}  type='date'
                        onChange={e => setInp({ ...inp, 检验日期1: e.currentTarget.value}) } />
            </InputLine>
            <InputLine  label='下次定期检验日期' >
                <Input  value={inp?.新下检日 ||''}  type='date'
                        onChange={e => setInp({ ...inp, 新下检日: e.currentTarget.value}) } />
            </InputLine>
        </LineColumn>
        {!nmemo && <>
            说明:
            <TextArea  value={inp?.结论说明 ||''} rows={8}
                       onChange={e => setInp({ ...inp, 结论说明: e.currentTarget.value||undefined}) } />
        </>}
    </InspectRecordLayout>;
});
